<style>
.attachmentInfoPageContent {
    width: 678px !important;
    height: 300px !important;
    border: 1px solid #D8DFE5;
    margin: 5px auto;
}
.attachmentInfoPageContent > * {
    float: left;
}
#attachmens {
    width: 278px;
}
</style>
<div id="attachmentInfoPageContent" class="pageContent attachmentInfoPageContent">
    <div style="width: 278px; height: 300px; overflow: hidden; overflow-y: auto;">
        <table id="attachmens" class="table canopration" >
            <thead>
                <tr>
                    <th width="40px"><@label key="serialNumber.C">序号</@label></th>
                    <th width="160px"><@label key="name.C">名称</@label></th>
                    <th width="50px"><@label key="opera.C">操作</@label></th>
                </tr>
            </thead>
            <tbody>
                <#list attachments as attachment>
                <tr value="${attachment.attachmentCode}">
                    <td>${attachment_index + 1}</td>
                    <td>${attachment.fileName}</td>
                    <td><a title="<@label key='download.B'>下载</@label>" target="dwzExport" href="${rc.getContextPath()}/manage/common/downloadAttachement?attachmentCode=${attachment.attachmentCode!''}&fileName=${attachment.fileName!''}" class="btnAttach" style="margin-top: 2px;"></a></td>
                </tr>
                </#list>
            </tbody>
        </table>
    </div>
    <img id="attachmentImg"    style="max-height: 300px; max-width: 400px; margin: auto; display: inline-block;" alt="" src="">
</div>
<div class="formBar" style="width: 680px; margin: 0px auto;">
    <ul>
        <li>
            <div class="buttonActive">
                <div class="buttonContent">
                    <button type="button" class="close">
                    <@label    key="close.B">关闭</@label></button>
                </div>
            </div>
        </li>
    </ul>
</div>
<script type="text/javascript">
    $(function(){
        setTimeout(function(){
            $('#attachmens tbody', '#attachmentInfoPageContent').on('click', 'tr', function(){
                var $this = $(this);
                $('#attachmentImg', '#attachmentInfoPageContent').attr({
                    src: hostUrl + '/common/showAttachement?attachmentCode=' + $(this).attr('value'),
                    alt: '<@label key="noProcessAttachmentGraph.C">该工艺流程图不存在，请检查数据!</@label>'
                });
            });
            $('#attachmens tbody > tr:first', '#attachmentInfoPageContent').click();
        }, 200);
    });
</script>